Lock-free release of shadow pages in a data storage application

ABSTRACT

Storage pages in a data storage application can be designated as having one of a used status, a free status, and a shadow status. The storage pages having the shadow status remain in use but available for conversion to the free status after completion of a savepoint. The storage pages designated to the shadow status can be assigned among at least a first group and a second group. A first savepoint can be invoked during which the storage pages designated to the shadow status and assigned to the first group are converted to the free status, and a second savepoint can be invoked during which the storage pages designated to the shadow status and assigned to the second group are converted to the free status. In this manner, locking of the system during a savepoint is not required. Related methods, systems, and articles of manufacture are also disclosed.

TECHNICAL FIELD

The subject matter described herein relates to optimizing performance indata storage applications (e.g. a database) and other computingenvironments in which data are written and/or read from a storage mediumor storage device.

BACKGROUND

Storage pages can be used in association with a data storage applicationthat writes and/or reads data from a persistency layer that can includeactive data stored in fast but relatively expensive memory that is inturn written to a less expensive storage for longer term retention. Thepersistence layer can ensure that changes made within the data storageapplication are durable and that the data storage application can berestored to a most recent committed state after a restart. A committedstate is achieved by writing the changes made to data in the persistencelayer to the longer term storage. Data are stored in the longer termstorage are organized in storage pages, a term that refers to a unit ofphysical storage.

A shadow paging technique can be used in conjunction with data storageapplications to avoid overwriting an existing version of a page withchanges until the changes are ready to be committed to longer termstorage. For example, shadow paging can be used to undo changes thatwere written to the longer term storage since a most recent savepoint. Ashadow page can be allocated to retain the original state of a logicalpage when the logical page is to be modified. A storage page retained inthe longer term storage at a most recent savepoint are not overwrittenuntil a subsequent savepoint is successfully completed. Instead, newphysical pages are used to store changed logical pages. Therefore, untilthe subsequent savepoint is written to longer term storage, two physicalpages may exist for one logical page: a shadow page containing theversion written during the most recent savepoint, and a current physicalpage reflecting changes written to longer term storage since the mostrecent savepoint.

SUMMARY

In one aspect, a method includes designating storage pages in a datastorage application as having one of a used status, a free status, and ashadow status. The storage pages with the shadow status remain in usebut available for conversion to the free status after completion of asavepoint. The storage pages designated to the shadow status areassigned among at least a first group and a second group. A firstsavepoint is invoked during which the storage pages designated to theshadow status and assigned to the first group are converted to the freestatus. A second savepoint is later invoked during which the storagepages designated to the shadow status and assigned to the second groupare converted to the free status.

In some variations one or more of the following features can optionallybe included in any feasible combination. The data storage applicationcan include at least one of a database application and anetwork-attached storage system. The storage pages designated to theshadow status can be assigned to either of the first group and thesecond group. The first group can be assigned to the first savepoint,which has an odd numbered label, and the second group can be assigned tothe second savepoint, which has an even numbered label. While the firstsavepoint is being invoked, a new page to be designated to the shadowstate is assigned to the second group. A new page can be designated tothe shadow state during the invoking of either of the first savepointand the second savepoint, for example by being assigned to the groupwhose savepoint is not currently being invoked. The storage pages can beretained on a storage medium accessible to the data storage application.The designating of the used status, the free status, and the shadowstatus can be performed by a block status management module in apersistence layer of the data storage application.

Articles are also described that comprise a tangibly embodiedmachine-readable medium operable to cause one or more machines (e.g.,computers, etc.) to result in operations described herein. Similarly,computer systems are also described that may include a processor and amemory coupled to the processor. The memory may include one or moreprograms that cause the processor to perform one or more of theoperations described herein.

The details of one or more variations of the subject matter describedherein are set forth in the accompanying drawings and the descriptionbelow. Other features and advantages of the subject matter describedherein will be apparent from the description and drawings, and from theclaims. For example, while the specific examples described below toillustrate features of the current subject matter make reference to thedata storage application being a database, other types of data storageapplications are within the scope of the current subject matter.

DESCRIPTION OF DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this specification, show certain aspects of the subject matterdisclosed herein and, together with the description, help explain someof the principles associated with the disclosed implementations. In thedrawings,

FIG. 1 is a box diagram illustrating aspects of a system at least someof whose features are consistent with implementations of the currentsubject matter;

FIG. 2 is a process flow diagram illustrating features of a methodconsistent with implementations of the current subject matter;

FIG. 3 is a diagram illustrating features of a system architecture atleast some of whose features are consistent with implementations of thecurrent subject matter; and

FIG. 4 is a logic flow diagram illustrating features consistent with oneor more implementations of the current subject matter.

When practical, similar reference numbers denote similar structures,features, or elements.

DETAILED DESCRIPTION

FIG. 1 shows an example of a system 100 in which a computing system 102,which can include one or more programmable processors that can becollocated, linked over one or more networks, etc., executes one or moremodules, software components, or the like of a data storage application104. The data storage application 104 can include one or more of adatabase, an enterprise resource program, a distributed storage system(e.g. NetApp Filer available from NetApp of Sunnyvale, Calif.), or thelike.

The one or more modules, software components, or the like can beaccessible to local users of the computing system 102 as well as toremote users accessing the computing system 102 from one or more clientmachines 106 over a network connection 110. One or more user interfacescreens produced by the one or more first modules can be displayed to auser, either via a local display or via a display associated with one ofthe client machines 106. Data units of the data storage application 104can be transiently stored in a persistence layer 112 (e.g. a page bufferor other type of temporary persistency layer), which can write the data,in the form of storage pages, to one or more storages 114, for examplevia an input/output component 116. The one or more storages 114 caninclude one or more physical storage media or devices (e.g. hard diskdrives, persistent flash memory, random access memory, optical media,magnetic media, and the like) configured for writing data for longerterm storage. It should be noted that the storage 114 and theinput/output component 116 can be included in the computing system 102despite their being shown as external to the computing system 102 inFIG. 1.

Data retained at the longer term storage 114 can be organized in pages,each of which has allocated to it a defined amount of storage space. Insome implementations, the amount of storage space allocated to each pagecan be constant and fixed. For simplicity, features of the currentsubject matter are described with reference to such an approach.However, other implementations in which the amount of storage spaceallocated to each page can vary are also within the scope of the currentsubject matter. A data storage application 104 tracks which blocks ofdata storage in the storage 114 are “used” (i.e. have a page or part ofa page stored therein) and which are currently unused or “free.” Thetracking can in some implementations include an array of state values orsome other transient representation of free and used blocks in thestorage 114. In a shadow paging approach, a third status, which istechnically a subset of the “used” status, can be “shadow.” A page witha shadow status is is still in use but can be freed after completion ofa next savepoint. A typical block allocation manager or other componenttasked with maintaining assignment status information of memory blocksin the storage 114 may perform operations including allocating a blockhaving a free status to “used” when the block is required to contain alogical page or part thereof, releasing a block that has previously beenused to a “free” status once it is no longer needed, assigning a blockas a shadow block, and releasing a block previously set as a shadowblock back to a “free” status.

While the process of releasing shadow pages to the free status isoccurring, a system may enter a temporary lock state during which noother pages can be re-designated as having shadow status. A lock statecan be entered to synchronize the designating of pages with the shadowstatus and the freeing of pages previously designated as having shadowstatus. The lock can be necessary because, if a page is newly designatedas having the shadow state during the finite period of time during whicha savepoint operation is executed, that newly designated shadow pagewould be immediately freed along with the other shadow pages. However,entering a lock state by a data storage application 104 generallyreduces concurrency and thus increases runtime processing, which can beundesirable.

To address these and potentially other issues with currently availablesolutions, one or more implementations of the current subject matterprovide methods, systems, articles or manufacture, and the like thatcan, among other possible advantages, allow a temporal staggering ofsavepoint operations that affect specific shadow pages. Shadow pages canbe assigned to one of a set of alternating savepoints in two or moregroups such that shadow pages assigned to the first group are processedduring a first savepoint, shadow pages assigned to the second group areprocessed during a second savepoint, and so forth. In this manner,because only a subset of the shadow pages are written at each savepoint,a complete lock of the system during the synchronization process is notrequired. Creation, modification, etc. of shadow pages can remainenabled during the processing of the first group of shadow pages aschanges can be added to the non-locked group of shadow pages forprocessing with a later savepoint.

Implementations of the current subject matter can include featuresproviding one or both of these advantages. For example, the process flowchart 200 of FIG. 2 shows a method having at least some featuresconsistent with an implementation of the current subject matter. At 202,storage pages in a data storage application are designated as having oneof a used status, a free status, and a shadow status. As noted, thestorage pages having the shadow status remain in use but available forconversion to the free status after completion of a savepoint. At 204,the storage pages designated to the shadow status are assigned among atleast a first group and a second group. A first savepoint is invoked at206 during which the storage pages designated to the shadow status andassigned to the first group are converted to the free status.Subsequently, a second savepoint is invoked at 210 during which thestorage pages designated to the shadow status and assigned to the secondgroup are converted to the free status.

In one example, the first group and the second group can be assigned aseither an even or an odd shadow page. The savepoints can be numberedsequentially with increasing integer number labels. When a savepointhaving an odd number label is invoked, the odd-labeled shadow pages canbe converted to the free status. Then, when the next savepoint, whichhas an even number label, is invoked, the even-labeled shadow pages canbe converted to the free status. While a savepoint is in progress,storage pages to be newly designated as shadow pages are assigned onlyto a group whose savepoint is not currently in progress. Other numbersof savepoint groups are also within the scope of the current subjectmatter, and the labeling of shadow page groups and savepointscorresponding to these groups need not be performed only using theeven-odd example discussed herein. For example, shadow pages can beassigned to one of two or more groups, and savepoints corresponding toeach other shadow pages groups can be invoked in an alternating or otherpattern such that each shadow page group in eventually processed to beconverted to the free status.

FIG. 3 shows a software architecture 300 consistent with one or morefeatures of the current subject matter. A data storage application 104,which can be implemented in one or more of hardware and software, caninclude one or more of a database application, a network-attachedstorage system, or the like. According to at least some implementationsof the current subject matter, such a data storage application 104 caninclude or otherwise interface with a persistence layer 112 or othertype of memory buffer, for example via a persistence interface 302. Apage buffer 304 within the persistence layer 112 can store one or morelogical pages 306, optionally can include shadow pages, active pages,and the like. The logical pages 306 retained in the persistence layer112 can be written to a storage (e.g. a longer term storage) 114 via aninput/output component 116, which can be a software module, a sub-systemimplemented in one or more of software and hardware, or the like. Thestorage 114 can include one or more data volumes 310 where stored pages312 are allocated at physical memory blocks.

In some implementations, the data storage application 104 can include orbe otherwise in communication with a page manager 314 and/or a savepointmanager 316. The page manager 314 can communicate with a page managementmodule 320 at the persistence layer 112 that can include a free blockmanager 322 that monitors page status information 324, for example thestatus of physical pages within the storage 114 and logical pages in thepersistence layer 112 (and optionally in the page buffer 304). Thesavepoint manager 316 can communicate with a savepoint coordinator 326at the persistence layer 204 to handle savepoints, which are used tocreate a consistent persistent state of the database for restart after apossible crash.

In some implementations of a data storage application 104, the pagemanagement module of the persistence layer 112 can implement a shadowpaging approach as discussed above. The free block manager 322 withinthe page management module 320 can maintain the status of physical pagesand can assign the processes of converting storage page statuses betweenfree, used, and shadow in accordance with implementations describedherein. The page buffer 304 can included a fixed page status buffer thatoperates as discussed herein. A converter component 340, which can bepart of or in communication with the page management module 320, can beresponsible for mapping between logical and physical pages written tothe storage 114. The converter 340 can maintain the current mapping oflogical pages to the corresponding physical pages in a converter table342. The converter 340 can maintain a current mapping of logical pages306 to the corresponding physical pages in one or more converter tables342. When a logical page 306 is read from storage 114, the storage pageto be loaded can be looked up from the one or more converter tables 342using the converter 340. When a logical page is written to storage 114the first time after a savepoint, a new free physical page is assignedto the logical page. The free block manager 322 marks the new physicalpage as “used” and the new mapping is stored in the one or moreconverter tables 342.

The persistence layer 112 can ensure that changes made in the datastorage application 104 are durable and that the data storageapplication 104 can be restored to a most recent committed state after arestart. Writing data to the storage 114 need not be synchronized withthe end of the writing transaction. As such, uncommitted changes can bewritten to disk and committed changes may not yet be written to diskwhen a writing transaction is finished. After a system crash, changesmade by transactions that were not finished can be rolled back. Changesoccurring by already committed transactions should not be lost in thisprocess. A logger component 344 can also be included to store thechanges made to the data of the data storage application in a linearlog. The logger component can be used during recovery to replayoperations since last savepoint to ensure that all operations areapplied to the data and that transactions with a logged “COMMIT” recordare committed before rolling back still-open transactions at the end ofa recovery process.

In an example of a shadow paging approach to retaining uncommittedchanges, shadow page that contains a savepoint version of a logical pageis not overwritten until the next savepoint is successfully completed.This can be reflected in a page status table maintained by the system(e.g. in a free block manager as described below). As shown in thelogical flow diagram 400 of FIG. 4, a logical page L1 is written to afirst physical page P1 during a most recent savepoint at 402 and amapping (L1, P1) is added to a converter table 342. After the savepoint,at 404 the logical page L1 is modified again to become L1Δ. When L1needs to be written to the storage 114 again, for example because ofcache replacement or because the next savepoint operation has begun, thefirst physical page P1 becomes a shadow page S1 and a new free firstphysical page P2 is assigned to the logical page L1. The first physicalpage P2 is marked as “used” and a new mapping (L1, P2) is written to theconverter table 342 at 406. The old mapping is still available in an oldversion of the converter table that was stored with the most recentsavepoint. The first physical page P1 is still needed to retain theshadow page S1, so its status is not set to “free.” Instead, the firstphysical page P1 can be designated with a status of “free aftersavepoint.” When the next savepoint is completed at 410, the status ofthe first physical page P1 can then be updated to “free.”

Aspects of the subject matter described herein can be embodied insystems, apparatus, methods, and/or articles depending on the desiredconfiguration. In particular, various implementations of the subjectmatter described herein can be realized in digital electronic circuitry,integrated circuitry, specially designed application specific integratedcircuits (ASICs), computer hardware, firmware, software, and/orcombinations thereof. These various implementations can includeimplementation in one or more computer programs that are executableand/or interpretable on a programmable system including at least oneprogrammable processor, which can be special or general purpose, coupledto receive data and instructions from, and to transmit data andinstructions to, a storage system, at least one input device, and atleast one output device.

These computer programs, which can also be referred to programs,software, software applications, applications, components, or code,include machine instructions for a programmable processor, and can beimplemented in a high-level procedural and/or object-orientedprogramming language, and/or in assembly/machine language. As usedherein, the term “machine-readable medium” refers to any computerprogram product, apparatus and/or device, such as for example magneticdiscs, optical disks, memory, and Programmable Logic Devices (PLDs),used to provide machine instructions and/or data to a programmableprocessor, including a machine-readable medium that receives machineinstructions as a machine-readable signal. The term “machine-readablesignal” refers to any signal used to provide machine instructions and/ordata to a programmable processor. The machine-readable medium can storesuch machine instructions non-transitorily, such as for example as woulda non-transient solid state memory or a magnetic hard drive or anyequivalent storage medium. The machine-readable medium can alternativelyor additionally store such machine instructions in a transient manner,such as for example as would a processor cache or other random accessmemory associated with one or more physical processor cores.

To provide for interaction with a user, the subject matter describedherein can be implemented on a computer having a display device, such asfor example a cathode ray tube (CRT) or a liquid crystal display (LCD)monitor for displaying information to the user and a keyboard and apointing device, such as for example a mouse or a trackball, by whichthe user may provide input to the computer. Other kinds of devices canbe used to provide for interaction with a user as well. For example,feedback provided to the user can be any form of sensory feedback, suchas for example visual feedback, auditory feedback, or tactile feedback;and input from the user may be received in any form, including, but notlimited to, acoustic, speech, or tactile input. Other possible inputdevices include, but are not limited to, touch screens or othertouch-sensitive devices such as single or multi-point resistive orcapacitive trackpads, voice recognition hardware and software, opticalscanners, optical pointers, digital image capture devices and associatedinterpretation software, and the like.

The subject matter described herein can be implemented in a computingsystem that includes a back-end component, such as for example one ormore data servers, or that includes a middleware component, such as forexample one or more application servers, or that includes a front-endcomponent, such as for example one or more client computers having agraphical user interface or a Web browser through which a user caninteract with an implementation of the subject matter described herein,or any combination of such back-end, middleware, or front-endcomponents. A client and server are generally, but not exclusively,remote from each other and typically interact through a communicationnetwork, although the components of the system can be interconnected byany form or medium of digital data communication. Examples ofcommunication networks include, but are not limited to, a local areanetwork (“LAN”), a wide area network (“WAN”), and the Internet. Therelationship of client and server arises by virtue of computer programsrunning on the respective computers and having a client-serverrelationship to each other.

The implementations set forth in the foregoing description do notrepresent all implementations consistent with the subject matterdescribed herein. Instead, they are merely some examples consistent withaspects related to the described subject matter. Although a fewvariations have been described in detail herein, other modifications oradditions are possible. In particular, further features and/orvariations can be provided in addition to those set forth herein. Forexample, the implementations described above can be directed to variouscombinations and sub-combinations of the disclosed features and/orcombinations and sub-combinations of one or more features further tothose disclosed herein. In addition, the logic flows depicted in theaccompanying figures and/or described herein do not necessarily requirethe particular order shown, or sequential order, to achieve desirableresults. The scope of the following claims may include otherimplementations or embodiments.

1. A computer program product comprising a machine-readable mediumstoring instructions that, when executed by at least one programmableprocessor, cause the at least one programmable processor to performoperations comprising: designating storage pages in a data storageapplication as having one of a used status, a free status, and a shadowstatus, the storage pages having the shadow status remaining in use butavailable for conversion to the free status after completion of asavepoint; assigning the storage pages designated to the shadow statusamong at least a first group and a second group; invoking a firstsavepoint during which the storage pages designated to the shadow statusand assigned to the first group are converted to the free status; andinvoking a second savepoint during which the storage pages designated tothe shadow status and assigned to the second group are converted to thefree status.
 2. A computer program product as in claim 1, wherein thedata storage application comprises at least one of a databaseapplication and a network-attached storage system.
 3. A computer programproduct as in claim 1, wherein the storage pages designated to theshadow status are assigned to either of the first group and the secondgroup, the first group being assigned to the first savepoint, which hasan odd numbered label, and the second group being assigned to the secondsavepoint, which has an even numbered label.
 4. A computer programproduct as in claim 1, wherein, while the first savepoint is beinginvoked, a new page to be designated to the shadow state is assigned tothe second group.
 5. A computer program product as in claim 1, wherein anew page can be designated to the shadow state during the invoking ofeither of the first savepoint and the second savepoint.
 6. A computerprogram product as in claim 1, wherein the storage pages are retained ona storage medium accessible to the data storage application and thedesignating of the used status, the free status, and the shadow statusis performed by a block status management module in a persistence layerof the data storage application.
 7. A system comprising: at least oneprogrammable processor; and a machine-readable medium storinginstructions that, when executed by the at least one programmableprocessor, cause the at least one programmable processor to performoperations comprising: designating storage pages in a data storageapplication as having one of a used status, a free status, and a shadowstatus, the storage pages having the shadow status remaining in use butavailable for conversion to the free status after completion of asavepoint; assigning the storage pages designated to the shadow statusamong at least a first group and a second group; invoking a firstsavepoint during which the storage pages designated to the shadow statusand assigned to the first group are converted to the free status; andinvoking a second savepoint during which the storage pages designated tothe shadow status and assigned to the second group are converted to thefree status.
 8. A system as in claim 7, wherein the data storageapplication comprises at least one of a database application and anetwork-attached storage system.
 9. A system as in claim 7, wherein thestorage pages designated to the shadow status are assigned to either ofthe first group and the second group, the first group being assigned tothe first savepoint, which has an odd numbered label, and the secondgroup being assigned to the second savepoint, which has an even numberedlabel.
 10. A system as in claim 7, wherein, while the first savepoint isbeing invoked, a new page to be designated to the shadow state isassigned to the second group.
 11. A system as in claim 7, wherein a newpage can be designated to the shadow state during the invoking of eitherof the first savepoint and the second savepoint.
 12. A system as inclaim 7, wherein the storage pages are retained on a storage mediumaccessible to the data storage application and the designating of theused status, the free status, and the shadow status is performed by ablock status management module in a persistence layer of the datastorage application.
 13. A computer-implemented method comprising:designating storage pages in a data storage application as having one ofa used status, a free status, and a shadow status, the storage pageshaving the shadow status remaining in use but available for conversionto the free status after completion of a savepoint; assigning thestorage pages designated to the shadow status among at least a firstgroup and a second group; invoking a first savepoint during which thestorage pages designated to the shadow status and assigned to the firstgroup are converted to the free status; and invoking a second savepointduring which the storage pages designated to the shadow status andassigned to the second group are converted to the free status.
 14. Acomputer-implemented method as in claim 13, wherein the data storageapplication comprises at least one of a database application and anetwork-attached storage system.
 15. A computer-implemented method as inclaim 13, wherein the storage pages designated to the shadow status areassigned to either of the first group and the second group, the firstgroup being assigned to the first savepoint, which has an odd numberedlabel, and the second group being assigned to the second savepoint,which has an even numbered label.
 16. A computer-implemented method asin claim 13, wherein, while the first savepoint is being invoked, a newpage to be designated to the shadow state is assigned to the secondgroup.
 17. A computer-implemented method as in claim 13, wherein a newpage can be designated to the shadow state during the invoking of eitherof the first savepoint and the second savepoint.
 18. Acomputer-implemented method as in claim 13, wherein the storage pagesare retained on a storage medium accessible to the data storageapplication and the designating of the used status, the free status, andthe shadow status is performed by a block status management module in apersistence layer of the data storage application.
 19. Acomputer-implemented method as in claim 13, wherein at least one of thedesignating, the assigning, the invoking of the first savepoint, and theinvoking of the second savepoint is performed by at least oneprogrammable processor.